import { _decorator, Component, Node, NodeEventType } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Talent')
export class Talent extends Component {
    protected onEnable(): void {
        this.node.on(Node.EventType.TOUCH_START, this.onTouchStart, this, true);
        this.node.on(Node.EventType.TOUCH_END, this.onTouchEnd, this, true);
        this.node.on(Node.EventType.TOUCH_CANCEL, this.onTouchEnd, this, true);
    }

    protected onDisable(): void {
        this.node.off(Node.EventType.TOUCH_START, this.onTouchStart, this, true);
        this.node.off(Node.EventType.TOUCH_CANCEL, this.onTouchEnd, this, true);
        this.node.off(Node.EventType.TOUCH_END, this.onTouchEnd, this, true);
    }

    start() {

    }

    update(deltaTime: number) {

    }

    onTouchStart() {
        this.node.setScale(.9,.9);
    }

    onTouchEnd() {
        this.node.setScale(1,1);
    }
}


